package org.zdc.pivot.wtk.skin;

import nme.display.Graphics;
import org.zdc.pivot.wtk.Container;
import org.zdc.pivot.wtk.Component;
import org.zdc.pivot.wtk.IFocusTraversalPolicy;
import org.zdc.pivot.wtk.skin.ComponentSkin;
import org.zdc.pivot.wtk.listener.IContainerListener;
import org.zdc.pivot.wtk.listener.IContainerMouseListener;

class ContainerSkin extends ComponentSkin,
					implements IContainerListener
					//implements IContainerMouseListener
{
	private var backgroundPaint:Dynamic;
	
	public function new() 
	{
		super();
	}
	
	override public function install(c:Component):Void {
		super.install(component);
		
		var con:Container = untyped c;
		
		con.getContainerListeners().add(this);
		//con.getContainerMouseListeners().add(this);
		
	}
	
	override public function getPreferredWidth(height:Float):Float {
		return 0;
	}
	
	override public function getPreferredHeight(width:Float):Float {
        return 0;
    }
	
	override public function paint():Void 
	{
		if (backgroundPaint != null) {
			
		}
		super.paint();
	}
	
	/**
	 * 
	 * @param	backgroundPaint
	 */
	public function setBackgroundPaint(backgroundPaint:Dynamic):Void {
		
	}
	
	/**
	 * 获取背景颜色
	 * @return
	 */
	public function getBackgroundColor():Int {
		return 0;
	}
	
	/**
	 * 设置背景颜色
	 * @param	backgroundColor
	 */
	public function setBackgroundColor(backgroundColor:Int):Void {
		
	}
	
	/**
	 * 当组件加入容器时
	 * @param	container
	 * @param	index
	 */
	public function componentInserted(container:Container, index:Int):Void {
		
	}
	
	/**
	 * 当组件被删除时
	 * @param	container
	 * @param	index
	 * @param	removed
	 */
	public function componentsRemoved(container:Container, index:Int, removed:Array<Component>):Void {
		
	}
	
	/**
	 * 当组件被删除时
	 * @param	container
	 * @param	index
	 * @param	removed
	 */
	public function componentMoved(container:Container, from:Float, to:Float):Void {
		
	}
	
	/**
	 * 当组件焦点遍历改变时
	 * @param	container
	 * @param	from
	 * @param	to
	 */
	public function focusTraversalPolicyChanged(container:Container, previousFocusTraversalPolicy:IFocusTraversalPolicy):Void {
		
	}
	
}